package org.daochong.lang;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.daochong.lang.Page;
import org.daochong.lang.PageResult;

public interface IService<T> {

	public T load(T obj) throws SQLException;

	public T load(Object... keys) throws SQLException;

	public boolean create(T obj) throws SQLException;

	public boolean save(T obj) throws SQLException;

	public boolean updateWithoutNull(T obj) throws SQLException;

	public boolean updatePart(Map<String, Object> data, String... keys) throws SQLException;

	public boolean exists(T obj) throws SQLException;

	public boolean exists(Object... keys) throws SQLException;

	public boolean delete(T obj) throws SQLException;

	public boolean delete(Object... keys) throws SQLException;

	public List<T> list() throws SQLException;

	public List<T> list(Map<String, Object> parms)throws SQLException;

	public PageResult<T> list(Page page)throws SQLException;

	public PageResult<T> list(Page page, String sql)throws SQLException;

	public PageResult<T> list(Page page, String sql, List<Object> params)throws SQLException;

	public PageResult<T> list(Page page, String sql, Map<String, Object> params)throws SQLException;

	public PageResult<T> list(Page page, Map<String, Object> params)throws SQLException;

	public PageResult<T> list(Page page, Map<String, Object> params, Map<String, String> orders) throws SQLException;

}
